#include<iostream>
#include<cstdio>
#include<string>
#include<cstdlib>
using namespace std;
string name;
string cpp,infile;
string tmp;
string frein,freout;
void code_out()
{
	printf("#include<iostream>\n");
	printf("#include<cstdio>\n");
	printf("#include<cstdlib>\n");
	printf("#include<string>\n");
	printf("#include<algorithm>\n");
	printf("#include<cmath>\n");
	printf("#include<map>\n");
	printf("#include<queue>\n\n");
	
	printf("using namespace std;\n\n");
	
	printf("int main()\n");
	printf("{\n\t");
	printf(frein.c_str());
	printf("\n\t");
	printf(freout.c_str());
	printf("\n\t\n\t");
	printf("return 0;\n");
	printf("}\n");
}

void build_file_name()
{
	tmp="mkdir "+name;
	system(tmp.c_str());
	cpp=name+"/"+name+".cpp";
	infile=name+"/"+name+".in";
	frein="freopen(\""+name+".in\",\"r\",stdin);";
	freout="freopen(\""+name+".out\",\"w\",stdout);";
}

int main()
{
	while(1)
	{
		getline(cin,name);
		build_file_name();
		freopen(infile.c_str(),"w",stdout);
		freopen(cpp.c_str(),"w",stdout);
		code_out();
	}
}
